package com.confee.guanglai.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

import org.hibernate.validator.constraints.Length;
import org.springframework.data.jpa.domain.AbstractPersistable;

import com.confee.guanglai.commons.GlobleConstants;

/**
 * 员工Entity.
 * 
 * @author 李忠
 * 
 */
@Entity
@Table(name = "t_user")
public class User extends AbstractPersistable<Long> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Length(min = 4, max = 10)
	@Column(unique = true)
	private String no;

	@Length(min = 1, max = 20)
	private String name;

	@Length(min = 1, max = 20)
	private String password;

	@Column(length = 20)
	private String hometown;

	@Column(length = 50)
	private String mobile;

	@Length(min = 1, max = 1)
	private String status;

	public User() {
		super();
		this.status = GlobleConstants.STATUS_NORMAL;
	}

	public User(String no, String name, String password, String hometown, String mobile) {
		super();
		this.no = no;
		this.name = name;
		this.password = password;
		this.hometown = hometown;
		this.mobile = mobile;
		this.status = GlobleConstants.STATUS_NORMAL;
	}

	public String getNo() {
		return no;
	}

	public void setNo(String no) {
		this.no = no;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getHometown() {
		return hometown;
	}

	public void setHometown(String hometown) {
		this.hometown = hometown;
	}

	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

}
